﻿@model IList<GameViewModel.Person>

<p>
    @Html.ActionLink("Добавить игрока", "CreatePerson", "Home")
</p>
<table>
    
    @for (var i = 0; i < Model.Count(); i++)
    {
        var item = Model[i];
        <tr>
            <td>
                @{
                    var htmlAttributes = new
                    {
                        data_url = Url.Action("PersonChecked", "Home"), 
                        itemId = "personCheckBox",
                        personId = item.Id
                    };
                }
                <label>@Html.CheckBox(item.Name, item.IsSelected, htmlAttributes)@item.Name</label>

            </td>
            <td>
                @Html.ActionLink("Переименовать", "EditPerson", "Home", new { personId = item.Id }, new { data_rel="dialog"} ) |
                @Html.ActionLink("Удалить", "DeletePerson", "Home", new { personId = item.Id }, null)
            </td>
        </tr>
    }

</table>
